Skip to content

feat(adk): support responses API for Python ADK agents - #2679

Merged
EItanya merged 2 commits into
kagent-dev:release/v0.10.xfrom
onematchfox:python-responses-api
Sep 4, 2026
Merged

feat(adk): support responses API for Python ADK agents#2679
EItanya merged 2 commits into
kagent-dev:release/v0.10.xfrom
onematchfox:python-responses-api

Conversation

@onematchfox

Copy link
Copy Markdown
Contributor

Responses API is required in order to use reasoning effort with newer Open AI models. #2369 (backported to v0.10.x in #2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes #2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration.

@github-actions github-actions Bot added the enhancement New feature or request label Sep 3, 2026
@onematchfox

Copy link
Copy Markdown
Contributor Author

Will cherry-pick and open against main after review

@EItanya

EItanya commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Is this ready for review, the upgrade tests are broken because of a bad release tag

@onematchfox
onematchfox marked this pull request as ready for review September 4, 2026 09:42
@onematchfox
onematchfox requested a review from a team as a code owner September 4, 2026 09:42
Copilot AI lite review requested due to automatic review settings September 4, 2026 09:42
@onematchfox

Copy link
Copy Markdown
Contributor Author

Is this ready for review, the upgrade tests are broken because of a bad release tag

Had a couple tweaks I wanted to make as well as some testing to do - all done now and ready for your 👀

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The non-streaming Responses API path currently doesn’t surface status="failed" / error responses as LlmResponse errors, which can silently mask request failures.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR completes the earlier Go-only Responses API support by wiring Python ADK OpenAI agents to honor ModelConfig.openAI.apiFormat, enabling newer OpenAI models that require the Responses API (e.g., when using reasoning effort).

Changes:

  • Add api_format to the Python ADK OpenAI model config and pass it through when instantiating the runtime LLM.
  • Implement Responses API request/response conversions and route OpenAI calls to /v1/responses when configured.
  • Add unit tests covering conversions, request shaping (reasoning/tools/tokens), and streaming behavior for Responses API.
File summaries
File Description
python/packages/kagent-adk/tests/unittests/models/test_openai_responses.py Adds unit tests for Responses API conversions and execution paths (streaming + non-streaming).
python/packages/kagent-adk/src/kagent/adk/types.py Extends the OpenAI model config schema with api_format and plumbs it into LLM creation.
python/packages/kagent-adk/src/kagent/adk/models/_openai.py Implements Responses API support (input/tools conversion, output conversion, streaming handling) and switches behavior based on api_format.
go/api/v1alpha2/modelconfig_types.go Generalizes the OpenAI API format comment to apply to the ADK runtime (not Go-only).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/packages/kagent-adk/src/kagent/adk/models/_openai.py
Responses API is required in order to use reasoning effort with newer Open AI models.  kagent-dev#2369 (backported to `v0.10.x` in kagent-dev#2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes kagent-dev#2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration.

Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The Responses API support is fully wired through configuration, includes explicit error handling for failed responses, and is backed by thorough unit tests for both streaming and non-streaming paths.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@EItanya
EItanya enabled auto-merge (squash) September 4, 2026 13:54
@onematchfox

Copy link
Copy Markdown
Contributor Author

@EItanya see you enabled auto-merge - not sure this will merge automatically due to the broken upgrade tests will it?

@EItanya
EItanya disabled auto-merge September 4, 2026 14:40
@EItanya
EItanya merged commit cae75fa into kagent-dev:release/v0.10.x Sep 4, 2026
29 of 31 checks passed
@onematchfox
onematchfox deleted the python-responses-api branch September 4, 2026 14:50
onematchfox added a commit to onematchfox/kagent that referenced this pull request Sep 4, 2026
EItanya added a commit that referenced this pull request Sep 4, 2026
#2679 against main

Disclaimer: got Claude to cherry-pick and handle conflicts - I don't
have a working dev environment against main at present

Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants